package com.pm.business.service.impl;

import java.util.List;
import com.pm.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.pm.business.mapper.CompeteEnterpriseBadBehaviorMapper;
import com.pm.business.domain.CompeteEnterpriseBadBehavior;
import com.pm.business.service.ICompeteEnterpriseBadBehaviorService;

/**
 * 不良行为Service业务层处理
 * 
 * @author zxl
 * @date 2022-05-07
 */
@Service
public class CompeteEnterpriseBadBehaviorServiceImpl implements ICompeteEnterpriseBadBehaviorService 
{
    @Autowired
    private CompeteEnterpriseBadBehaviorMapper competeEnterpriseBadBehaviorMapper;

    /**
     * 查询不良行为
     * 
     * @param behaviorId 不良行为主键
     * @return 不良行为
     */
    @Override
    public CompeteEnterpriseBadBehavior selectCompeteEnterpriseBadBehaviorByBehaviorId(Long behaviorId)
    {
        return competeEnterpriseBadBehaviorMapper.selectCompeteEnterpriseBadBehaviorByBehaviorId(behaviorId);
    }

    /**
     * 查询不良行为列表
     * 
     * @param competeEnterpriseBadBehavior 不良行为
     * @return 不良行为
     */
    @Override
    public List<CompeteEnterpriseBadBehavior> selectCompeteEnterpriseBadBehaviorList(CompeteEnterpriseBadBehavior competeEnterpriseBadBehavior)
    {
        return competeEnterpriseBadBehaviorMapper.selectCompeteEnterpriseBadBehaviorList(competeEnterpriseBadBehavior);
    }

    /**
     * 新增不良行为
     * 
     * @param competeEnterpriseBadBehavior 不良行为
     * @return 结果
     */
    @Override
    public int insertCompeteEnterpriseBadBehavior(CompeteEnterpriseBadBehavior competeEnterpriseBadBehavior)
    {
        competeEnterpriseBadBehavior.setCreateTime(DateUtils.getNowDate());
        return competeEnterpriseBadBehaviorMapper.insertCompeteEnterpriseBadBehavior(competeEnterpriseBadBehavior);
    }

    /**
     * 修改不良行为
     * 
     * @param competeEnterpriseBadBehavior 不良行为
     * @return 结果
     */
    @Override
    public int updateCompeteEnterpriseBadBehavior(CompeteEnterpriseBadBehavior competeEnterpriseBadBehavior)
    {
        competeEnterpriseBadBehavior.setUpdateTime(DateUtils.getNowDate());
        return competeEnterpriseBadBehaviorMapper.updateCompeteEnterpriseBadBehavior(competeEnterpriseBadBehavior);
    }

    /**
     * 批量删除不良行为
     * 
     * @param behaviorIds 需要删除的不良行为主键
     * @return 结果
     */
    @Override
    public int deleteCompeteEnterpriseBadBehaviorByBehaviorIds(Long[] behaviorIds)
    {
        return competeEnterpriseBadBehaviorMapper.deleteCompeteEnterpriseBadBehaviorByBehaviorIds(behaviorIds);
    }

    /**
     * 删除不良行为信息
     * 
     * @param behaviorId 不良行为主键
     * @return 结果
     */
    @Override
    public int deleteCompeteEnterpriseBadBehaviorByBehaviorId(Long behaviorId)
    {
        return competeEnterpriseBadBehaviorMapper.deleteCompeteEnterpriseBadBehaviorByBehaviorId(behaviorId);
    }
}
